package com.droid.library.widget.recyclerview;

import android.app.Activity;
import android.support.v4.app.Fragment;
import android.support.v7.widget.RecyclerView;
import android.view.View;

import java.io.Serializable;

public abstract class BaseViewHolder<T extends Serializable> extends RecyclerView.ViewHolder {
    protected Activity mActivity;
    protected Fragment mFragment;
    protected BaseRecyclerAdapter<T> mAdapter;
    public BaseViewHolder(View itemView, Activity activity,BaseRecyclerAdapter<T> adapter) {
        super(itemView);
        this.mActivity = activity;
        mAdapter = adapter;
    }

    public BaseViewHolder(View itemView, Fragment fragment,BaseRecyclerAdapter<T> adapter) {
        super(itemView);
        this.mFragment = fragment;
        this.mActivity = mFragment.getActivity();
        mAdapter = adapter;
    }

    public abstract void onBindViewHolder(int position, T itemAtPosition);
}
